package cn.com.lms.business.examine.service;

import java.util.List;

import com.bnzj.core.persistence.BaseService;
import com.bnzj.core.persistence.query.QueryHelpBean;
import org.springframework.stereotype.Service;




import cn.com.lms.business.examine.persistence.entity.FbExamineInfo;
import cn.com.lms.business.examine.persistence.repository.FbExamineInfoRepository;

/**
 * @Author: 16266
 * @DateTime: 2020/3/13 14:17
 * @Description: 问卷调查业务层
 */
@Service
public class FbExamineInfoService extends BaseService<FbExamineInfoRepository, FbExamineInfo, Long> {

    /**
     * 查询问卷调查列表
     * @return
     */
    public QueryHelpBean getQueryHelpBean() {
        String selectSQL = "select  d.* ";
        String whereSQL = " from bnz_examine_list d where 1=1 ";
        QueryHelpBean queryBean = new QueryHelpBean(selectSQL + whereSQL, "select count(1)" + whereSQL, FbExamineInfo.class);
        return queryBean;
    }

    /**
     * 查询问卷调查详情
     * @param id
     * @return
     */
    public List<FbExamineInfo> findChild(Long id) {
        return repository.findAllByParentId(id);
    }
}
